refactor(ast): re-order layout assertions in memory order#20583
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
Pull request overview
Refactors the AST layout-assertion generator to emit struct field offset_of! assertions in ascending memory-offset order, making the generated layout files easier to read and reason about.
Changes:
- Sort struct fields by computed offset before generating
offset_of!assertions. - Update generator internals to pass the sorted field list through the assertion-generation path.
- Regenerate
assert_layouts.rsoutputs across affected crates with the reordered assertions.
Reviewed changes
Copilot reviewed 1 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tasks/ast_tools/src/generators/assert_layouts.rs | Sorts fields by offset (stable) before emitting offset assertions. |
| napi/parser/src/generated/assert_layouts.rs | Regenerated layout assertions with offsets ordered by memory layout. |
| crates/oxc_syntax/src/generated/assert_layouts.rs | Regenerated layout assertions with offsets ordered by memory layout. |
| crates/oxc_regular_expression/src/generated/assert_layouts.rs | Regenerated layout assertions with offsets ordered by memory layout. |
| crates/oxc_linter/src/generated/assert_layouts.rs | Regenerated layout assertions with offsets ordered by memory layout. |
| crates/oxc_ast/src/generated/assert_layouts.rs | Regenerated layout assertions with offsets ordered by memory layout. |
| crates/oxc_allocator/src/generated/assert_layouts.rs | Regenerated layout assertions with offsets ordered by memory layout. |
2dfbe32 to
cc4867c
Compare
940fab3 to
9d78591
Compare
Merge activity
|
Refactor. Generate assertions for type sizes in the order which they are in memory. This makes it easier to see how these types are laid out in memory.
9d78591 to
d5b9738
Compare
cc4867c to
e984666
Compare
…t#20583) Refactor. Generate assertions for type sizes in the order which they are in memory. This makes it easier to see how these types are laid out in memory.

Refactor. Generate assertions for type sizes in the order which they are in memory. This makes it easier to see how these types are laid out in memory.